Repository navigation
Learning loops proven: every reviewed PR teaches calibration, the coder learns specific lessons and its own variants, and a health check shows a quiet loop - #502
Merged
Conversation
…er learns specific lessons and its own variants, and a health check shows a quiet loop An audit of production learning found loops that ran but taught little: - Review comments left open were scored only on CoderHelm's own PRs, so calibration of people's PRs could only raise a category, never quiet one. Since the reviewer approves with notes, a person merging over a Nit fed nothing. - Coder lessons said only "read the surrounding code", came in near copies, and rested on an edit share that counted a merge of the base branch as people's edits (100% on almost every updated PR). They never reached the coder's own prompt. - The coder had no prompt variants, so its outcomes credited nothing. - Closes the webhook missed were written to the run but never scored; reverts carried no area or variant. - The stop judge's outcome log never recorded an approval over a block, read every later commit as a fix, and fed only analytics. Changes: - Every PR CoderHelm reviewed is scored at close. Each thread is acted on (resolved by CoderHelm or its lines changed), dismissed (resolved by a person, lines unchanged) or left open (untouched at merge; an FYI never counts), credited to the review's arm, with idempotent keys. - People's edits come from their own non-merge commits, with the files they touched and their commit subjects. The close reason joins the closed event, including an answer given later. - One coder lesson per area names what people changed and said and what to do next. Old generic lessons are replaced, and numbers no longer make a lesson look new. Lessons and the arm's addendum go into the coder's system prompt, capped, as well as the planner's. - The coder has three variants, chosen once per run, noted on the run and credited at close (reverts included). - The reconcile and backfill sweeps score what they record. - Merge outcomes compare each block's head with the merged head. A person approving over a standing block is recorded as overrode. The stop judge is given the team's recent decisions of the same kind that people overturned. - GET /api/learning/health: per loop, the last signal, the 7-day count, what should have fed it, and red when a loop that should fire is quiet. - Replay cases for the four gaps.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
An audit of production found learning loops that ran but taught little, and one that didn't exist:
Changes
Every reviewed PR is scored at close. This covers people's PRs and CoderHelm's own. Each CoderHelm thread is recorded as:
Events are credited to the review's prompt variant. Dedup keys are shared with the existing paths, so nothing counts twice.
People's edits are measured accurately. Only their own non-merge commits count, with the files they touched and their commit subjects. The close reason joins the closed event, including an answer given later.
One coder lesson per area names what people changed and said, and what to do next. Old generic lessons are replaced, and numbers no longer make a lesson look new. Lessons and the variant's addendum go into the coder's system prompt (capped) as well as the planner's.
The coder has three prompt variants, chosen once per run, noted on the run, and credited at close (reverts included). They can be pinned like the reviewer's.
The reconcile and backfill sweeps score what they record.
The decision log is complete. A merge compares each block's head with the merged head. A person approving over a standing block is recorded as overrode. The stop judge's picture carries the team's recent decisions of the same kind that people overturned.
New
GET /api/learning/health. Per loop it returns the last signal, the 7-day count, what should have fed it, and red when a loop that should fire stayed quiet. Viewers and up can read it.Replay cases 10 to 13 cover the four gaps, with new case kinds
learning_threads,learning_edits,learning_coder_lessonanddecision_overturned.Verification
cargo fmt --all --checkis clean.cargo clippy -p common -p gateway -p worker --all-targets -- -D warningsis clean.WorkerMessagenow allowslarge_enum_variant: the ticket message grew one in-process field.cargo test -p common -p gateway -p workerpasses: common 1512, gateway 750, worker 1355. The replay suite runs inside the worker tests.